package com.ruoyi.system.domain.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.domain.base.datam.WiOrganB;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * WiOrganBTreeSelect
 * 
 * @author ruoyi
 */
public class WiOrganBTreeSelect implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private String id;

    /** 节点名称 */
    private String label;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<WiOrganBTreeSelect> children;

    public WiOrganBTreeSelect()
    {

    }

    public WiOrganBTreeSelect(WiOrganB wiOrganB)
    {
        this.id = wiOrganB.getOrgCd();
        this.label = wiOrganB.getOrgNm();
        this.children = wiOrganB.getChildren().stream().map(WiOrganBTreeSelect::new).collect(Collectors.toList());
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public List<WiOrganBTreeSelect> getChildren() {
        return children;
    }

    public void setChildren(List<WiOrganBTreeSelect> children) {
        this.children = children;
    }
}
